The present invention relates to compositing and flattening images.
Many image processing computer programs, such as the Adobe Illustrator® program, available from Adobe Systems Incorporated of San Jose, Calif., build a final image by compositing two or more graphical objects together. The objects may be thought of as drawn on stacked sheets of acetate. An image thus composited can have multiple objects on multiple layers of acetate.
Each object typically includes data and compositing controls. An object can have a value that represents the object's color. An object can have a second value that represents the object's degree of transparency. This second value can cause the object to be represented as one that is opaque, translucent, or transparent. An object can be represented by an array of pixels or analytically, e.g., by using segment paths to represent shape outlines, or by other functions which map positions to data values. A shape outline of an object is the outline of the object's shape. For example, the shape outline of a dot is its circumference. Shape outlines will be referred to as outlines.
Some of the objects can overlap, some can be transparent, and some overlapping objects can be transparent. When a transparent object overlaps other objects, the underlying objects, i.e., those on an underlying sheet, are viewable.
Flattening is the process of converting an image containing transparency into a visually identical image that does not contain transparency. One method of flattening involves planar mapping, a process that divides overlapping objects into atomic regions based on the intersections of the overlapping objects' respective outlines. Where segment paths analytically represent outlines, this division is usually performed by calculating the intersections of the segment paths of the overlapping objects. Outlines used for planar mapping will be referred to as planar-mapping outlines.
When flattening involves text, calculating path intersections as described above can be computationally intensive and can significantly burden computing resources. Several factors contribute to this problem. First, text outlines are typically complex and, accordingly, require numerous segment paths for representation. An object having many segment paths usually requires more processor time and memory to flatten than does one having few segment paths. Furthermore, text outlines are often curved and need to be described by second or third order expressions such as Bezier functions. Second or third order expressions usually require more processor time to flatten than do first order expressions. Additionally, because text outlines are often complex, the planar mapping of images involving text typically results in smaller and more numerous atomic regions than does planar mapping of images not involving text. An image having many small regions usually requires more processor time and memory to flatten than does an image having a few large regions. Thus, one problem in flattening images having text is that the process often requires great computing resources.
Another problem with flattening an image having text is that sometimes the font outlines required for planar mapping are unavailable. For example, some fonts have protected outlines and hence do not allow access to their segment paths. Additionally, some fonts such as bitmap fonts do not have outlines at all. Yet another problem with flattening an image having text arises from the conversion of native font information to outlines of text glyphs. Native font information, such as hinting data, is often not preserved in the conversion. Consequently, the quality of the flattened text can suffer, especially when the font size is small.
Objects that are not text can also present difficulties in flattening. For example, some objects have resolution-dependent outlines that are, thus, unavailable for planar mapping without a target resolution. These objects include ones having stroke instructions defining a width of the stroke based on a resolution of a selected output device. Also included are objects that have parametric bi-cubic or quadratic surfaces that define an outline based on a target resolution.